Function.prototype._call = function(context, ...args) {
  // 绑定this上下文到context上
  context.fn = this;
  let result = context.fn(...args);
  delete context.fn;
  return result;
}

Function.prototype._bind = function(context, args) {
  if(!Array.isArray(args)) {
    args = [args];
  }
  context.fn = this;
  let result = context.fn(...args);
  delete context.fn;
  return result;
}

Function.prototype._bind = function(context, ...args) {
  let _this = this;
  return function(...args2) {
    let all = args.concat(args2);
    return _this.apply(context, all);
  }
}

function test(a,b) {
  console.log(arguments);
  console.log(this.getAB)
  return a+b;
}

let obj = {
  getAB: function() {
    return 'aaa';
  }
}
console.log(test._bind(obj, 1, 2));